package com.skycode5.bean;
import com.cddeskywebsite.bean.AdminBean;
import com.cddeskywebsite.dao.AdminDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;


@WebServlet("/admin.jsp")
public class AdminServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        AdminDao adminDao = new AdminDao();
        List<AdminBean> admin = adminDao.getList();
        req.setAttribute("admin", admin);
        req.getRequestDispatcher("adminUser.jsp").forward(req, resp);
    }
}

